package com.weishenai.customerassistant.controller;

import com.weishenai.customerassistant.utils.NetworkUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

@RestController
@Slf4j
public class IndexController {
    @RequestMapping({"", "/"})
    public String index(HttpServletRequest request) throws IOException {
        log.info("ip地址为:"+ NetworkUtil.getIpAddress(request)+"访问了主页");
        return "You're a retard";
    }
}
